home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Networking / MoreNetworkSetup / MoreInterfaceLib / MoreInterfaceLib.c next >
Encoding:
Text File  |  2000-09-28  |  33.4 KB  |  895 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        MoreInterfaceLib.c
  3.  
  4.     Contains:    Compatibility shim for routines not in InterfaceLib.
  5.  
  6.     Written by:    Quinn
  7.  
  8.     Copyright:    Copyright © 1999 by Apple Computer, Inc., all rights reserved.
  9.  
  10.                 You may incorporate this Apple sample source code into your program(s) without
  11.                 restriction. This Apple sample source code has been provided "AS IS" and the
  12.                 responsibility for its operation is yours. You are not permitted to redistribute
  13.                 this Apple sample source code as "Apple sample source code" after having made
  14.                 changes. If you're going to re-distribute the source, we require that you make
  15.                 it clear in the source that the code was descended from Apple sample source
  16.                 code, but that you've made changes.
  17.  
  18.     Change History (most recent first):
  19.  
  20.         <12>      6/3/00    Quinn   Added modern Time Manager interfaces.
  21.         <11>    18/10/99    Quinn   Convert MoreAssert's to, more correct, MoreAssertQ's.
  22.         <10>     16/9/99    Quinn   Add FSM FCB accessors.
  23.          <9>     16/8/99    Quinn   Added comment about nasty restriction with MorePBRemoteAccess.
  24.          <8>     22/7/99    Quinn   Use correct ProcInfo in MoreAddDrive.
  25.          <7>     15/6/99    Quinn   Added MoreBlockZero.
  26.          <6>     15/6/99    Quinn   Fixed Gestalt Value glue for pre-8.5 systems.  Added Extended
  27.                                     Disk Init Package routines.
  28.          <5>     22/4/99    Quinn   Added PBRemoteAccess.
  29.          <4>     20/4/99    Quinn   Added Gestalt Value routines.
  30.          <3>     16/3/99    Quinn   Added MoreUTFindDrive and MoreAddDrive.  Also fixed some mixups
  31.                                     about which traps are toolbox traps and which aren't.
  32.          <2>      1/3/99    Quinn   Added MoreFlushCodeCacheRange.  Also some general tidy up.
  33.          <1>     25/2/99    Quinn   First checked in.
  34. */
  35.  
  36. /////////////////////////////////////////////////////////////////
  37. // MoreIsBetter Setup
  38.  
  39. #include "MoreSetup.h"
  40.  
  41. /////////////////////////////////////////////////////////////////
  42. // Mac OS Interfaces
  43.  
  44. #include <CodeFragments.h>
  45. #include <LowMem.h>
  46. #include <Traps.h>
  47. #include <FSM.h>
  48. #include <Gestalt.h>
  49. #include <DiskInit.h>
  50.  
  51. /////////////////////////////////////////////////////////////////
  52. // Our Prototypes
  53.  
  54. #include "MoreInterfaceLib.h"
  55.  
  56. /////////////////////////////////////////////////////////////////
  57.  
  58. // This file contains implementations of various Mac OS API routines
  59. // that were rolled in to InterfaceLib as of Mac OS 8.5.  They are
  60. // in the InterfaceLib stub library as of Universal Interfaces 3.2.
  61. // This code does the magic to decide whether the routine is available
  62. // via InterfaceLib, or whether we have to synthesise our own MixedMode
  63. // glue (or, in some cases, implementation).
  64.  
  65. // If you use any of the routines in this library, you must either:
  66. //
  67. // a) continue to hard link to InterfaceLib, in which case you won't
  68. //    launch on pre-8.5 systems (with a cryptic error message), or
  69. // b) weak link to InterfaceLib, in which case you must check that you're
  70. //    on 8.5 or later before calling any of these routine lest
  71. //    you die by trying to call nil.
  72.  
  73. // You can change the definition of the following compiler variable,
  74. // which causes these routine to always use the InterfaceLib variant.
  75. // You'd better make sure they're available, as described above.
  76.  
  77. #ifndef MORE_MAC_OS_8_5_OR_LATER
  78.     #define MORE_MAC_OS_8_5_OR_LATER 0
  79. #endif
  80.  
  81. // Also, Universal Interfaces 3.2 defines macros for some missing
  82. // low memory accessors.  For CFM code, these macros override
  83. // the external procedure definition.  So you can no longer
  84. // call the real accessors, even if you do depend on Mac OS 8.5
  85. // or greater.  This hack fixes the problem.  [Radar ID 2308604]
  86.  
  87. #undef LMGetUnitTableEntryCount
  88. #undef LMSetUnitTableEntryCount
  89.  
  90. /////////////////////////////////////////////////////////////////
  91.  
  92. #if TARGET_RT_MAC_CFM
  93.  
  94. extern pascal SInt16 MoreLMGetUnitTableEntryCount(void)
  95. {
  96.     if (MORE_MAC_OS_8_5_OR_LATER || (LMGetUnitTableEntryCount != (void *) kUnresolvedCFragSymbolAddress)) {
  97.         return LMGetUnitTableEntryCount();
  98.     } else {
  99.         return *((SInt16 *) 0x01d2);
  100.     }
  101. }
  102.  
  103. extern pascal void   MoreLMSetUnitTableEntryCount(SInt16 value)
  104. {
  105.     if (MORE_MAC_OS_8_5_OR_LATER || (LMSetUnitTableEntryCount != (void *) kUnresolvedCFragSymbolAddress)) {
  106.         LMSetUnitTableEntryCount(value);
  107.     } else {
  108.         *((SInt16 *) 0x01d2) = value;
  109.     }
  110. }
  111.  
  112. #endif
  113.  
  114. /////////////////////////////////////////////////////////////////
  115. // Mixed Mode ProcInfo Helper
  116.  
  117. // Bit Numbers
  118. //
  119. //  3         2         1         0
  120. // 10987654321098765432109876543210
  121.  
  122. // Stack Based Layout
  123. //
  124. //                             cccc <- calling convention = kPascalStackBased (0), kCStackBased (1), kThinkCStackBased (5)
  125. //                           ss     <- result size
  126. //                         ss       <- stack parameter 1 size
  127. //                       ss         <- stack parameter 2 size
  128. //                     ss           <- stack parameter 3 size
  129. //                   ss             <- stack parameter 4 size
  130. //                 ss               <- stack parameter 5 size
  131. //               ss                 <- stack parameter 6 size
  132. //             ss                   <- stack parameter 7 size
  133. //           ss                     <- stack parameter 8 size
  134. //         ss                       <- stack parameter 9 size
  135. //       ss                         <- stack parameter 10 size
  136. //     ss                           <- stack parameter 11 size
  137. //   ss                             <- stack parameter 12 size
  138.  
  139. // Register Based Layout
  140. //
  141. //                             cccc <- calling convention = kRegisterBased (2)
  142. //                      rrrss       <- register result location and size
  143. //                 rrrss            <- register parameter 1 location and size
  144. //            rrrss                 <- register parameter 1 location and size
  145. //       rrrss                      <- register parameter 1 location and size
  146. //  rrrss                           <- register parameter 1 location and size
  147.  
  148. // Dispatched Stack Based Layout
  149. //
  150. //                             cccc <- calling convention = kD0DispatchedPascalStackBased (8), kD1DispatchedPascalStackBased (12), kD0DispatchedCStackBased (9), kStackDispatchedPascalStackBased (14)
  151. //                           ss     <- result size
  152. //                         ss       <- selector size
  153. //                       ss         <- stack parameter 1 size
  154. //                     ss           <- stack parameter 2 size
  155. //                   ss             <- stack parameter 3 size
  156. //                 ss               <- stack parameter 4 size
  157. //               ss                 <- stack parameter 5 size
  158. //             ss                   <- stack parameter 6 size
  159. //           ss                     <- stack parameter 7 size
  160. //         ss                       <- stack parameter 8 size
  161. //       ss                         <- stack parameter 9 size
  162. //     ss                           <- stack parameter 10 size
  163. //   ss                             <- stack parameter 11 size
  164.  
  165. // Special Case Layout
  166. //
  167. //                             cccc <- calling convention = kSpecialCase (15)
  168. //                       xxxxxx     <- special case selector (see "MixedMode.h")
  169.  
  170. // Values for "ss":
  171. //
  172. // 00 = kNoByteCode
  173. // 01 = kOneByteCode
  174. // 10 = kTwoByteCode
  175. // 11 = kFourByteCode
  176.  
  177. // Values for "rrr":
  178. //
  179. //
  180. // 000 = kRegisterD0
  181. // 001 = kRegisterD1
  182. // 010 = kRegisterD2
  183. // 011 = kRegisterD3
  184. // 100 = kRegisterA0
  185. // 101 = kRegisterA1
  186. // 110 = kRegisterA2
  187. // 111 = kRegisterA3
  188.  
  189. /////////////////////////////////////////////////////////////////
  190.  
  191. #if TARGET_RT_MAC_CFM
  192.  
  193. // DriverInstallReserveMem is a bit trickier to implement than the
  194. // previous two routines.  Basically we have get the address of the
  195. // _DriverInstall ($A03D) trap and then call it using
  196. // CallOSTrapUniversalProc.  There are a number of important things
  197. // to note here:
  198. //   a) We can just get the trap address and treat it as a UPP.
  199. //      The trap tables are defined to contain UPPs, either pointers
  200. //      to real 68K code, or pointers to a routine descriptor (if
  201. //      the trap is native or fat).
  202. //   b) We must use CallOSTrapUniversalProc, not CallUniversalProc.
  203. //      CallOSTrapUniversalProc automatically does a number of things 
  204. //      that are very critical for call OS traps.  See "IM:PowerPC
  205. //      System Software", p2-42 for a full description.
  206. //   c) When calling OS traps from PPC, it's important to get the
  207. //      ProcInfo right.  Specifically, all OS traps assume an
  208. //      implicit parameter of D1 as the first parameter.  After
  209. //      that, the parameters should be defined in the order that
  210. //      they are declared in the prototype.  If you fail to get
  211. //      the order right, or to put D1 first, your code will work,
  212. //      up until it encounters someone who has patched the OS trap
  213. //      with a native or fat patch.  Then strange things will happen,
  214. //      and you'll spend hours in MacsBug trying to figure it out.
  215.  
  216. // The trap number and ProcInfo description for DriverInstallReserveMem.
  217.  
  218. enum {
  219.     _DriverInstallReserveMem = 0x0A43D
  220. };
  221.  
  222. enum {
  223.     uppDriverInstallProcInfo = kRegisterBased
  224.         | REGISTER_RESULT_LOCATION(kRegisterD0)
  225.         | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  226.         | REGISTER_ROUTINE_PARAMETER(1, kRegisterD1, SIZE_CODE(sizeof(long)))
  227.         | REGISTER_ROUTINE_PARAMETER(2, kRegisterA0, SIZE_CODE(sizeof(DRVRHeaderPtr)))
  228.         | REGISTER_ROUTINE_PARAMETER(3, kRegisterD0, SIZE_CODE(sizeof(short)))
  229. };
  230.  
  231. // IMPORTANT: Previous versions of TradDriverLoaderLib defined parameter 1
  232. // as sizeof(short), not sizeof(long).  I fixed this based on information
  233. // I extracted from the official Apple version of this glue, in the 
  234. // InterfaceLib implementation on Mac OS 8.5.
  235.  
  236. extern pascal OSErr  MoreDriverInstallReserveMem(DRVRHeaderPtr drvrPtr, DriverRefNum refNum)
  237. {
  238.     if (MORE_MAC_OS_8_5_OR_LATER || (DriverInstallReserveMem != (void *) kUnresolvedCFragSymbolAddress)) {
  239.         return DriverInstallReserveMem(drvrPtr, refNum);
  240.     } else {
  241.         UniversalProcPtr trapAddress;
  242.         
  243.         // Check that I've got the ProcInfo correct.  This magic value
  244.         // was extracted from InterfaceLib on Mac OS 8.5.
  245.  
  246.         MoreAssertQ(uppDriverInstallProcInfo == 0x00533822);
  247.         
  248.         trapAddress = GetOSTrapAddress(_DriverInstallReserveMem);
  249.         return CallOSTrapUniversalProc(trapAddress, uppDriverInstallProcInfo, _DriverInstallReserveMem, drvrPtr, refNum);
  250.     }
  251. }
  252.  
  253. #endif
  254.  
  255. /////////////////////////////////////////////////////////////////
  256.  
  257. #if TARGET_RT_MAC_CFM
  258.  
  259. enum {
  260.     uppFlushCodeCacheRangeProcInfo = kRegisterBased |
  261.             RESULT_SIZE(SIZE_CODE(sizeof(OSErr))) |
  262.             REGISTER_RESULT_LOCATION(kRegisterD0) |
  263.             REGISTER_ROUTINE_PARAMETER(1, kRegisterD0, SIZE_CODE(sizeof(long))) |
  264.             REGISTER_ROUTINE_PARAMETER(2, kRegisterD1, SIZE_CODE(sizeof(long))) |
  265.             REGISTER_ROUTINE_PARAMETER(3, kRegisterA0, SIZE_CODE(sizeof(void *))) |
  266.             REGISTER_ROUTINE_PARAMETER(4, kRegisterA1, SIZE_CODE(sizeof(unsigned long)))
  267. };
  268.  
  269. extern pascal OSErr  MoreFlushCodeCacheRange(void *address, unsigned long count)
  270. {
  271.     if (MORE_MAC_OS_8_5_OR_LATER || (FlushCodeCacheRange != (void *) kUnresolvedCFragSymbolAddress)) {
  272.         return FlushCodeCacheRange(address, count);
  273.     } else {
  274.         UniversalProcPtr trapAddress;
  275.         
  276.         // Check that I've got the ProcInfo correct.  This magic value
  277.         // was extracted from InterfaceLib on Mac OS 8.5.
  278.  
  279.         MoreAssertQ(uppFlushCodeCacheRangeProcInfo == 0x5e671822);
  280.         
  281.         trapAddress = GetOSTrapAddress(_HWPriv);
  282.         return CallOSTrapUniversalProc(trapAddress, uppFlushCodeCacheRangeProcInfo, 9, _HWPriv, address, count);
  283.     }
  284. }
  285.  
  286. #endif
  287.  
  288. /////////////////////////////////////////////////////////////////
  289.  
  290. #if TARGET_RT_MAC_CFM
  291.  
  292. enum {
  293.     uppUTFindDriveProcInfo = kD0DispatchedPascalStackBased |
  294.             RESULT_SIZE(SIZE_CODE(sizeof(OSErr))) |
  295.             DISPATCHED_STACK_ROUTINE_SELECTOR_SIZE(SIZE_CODE(sizeof(long))) |
  296.             DISPATCHED_STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SInt16))) |
  297.             DISPATCHED_STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(DrvQElPtr *))),
  298.     uppUTLocateFCBProcInfo = kD0DispatchedPascalStackBased
  299.              | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  300.              | DISPATCHED_STACK_ROUTINE_SELECTOR_SIZE(kFourByteCode)
  301.              | DISPATCHED_STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(VCBPtr)))
  302.              | DISPATCHED_STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(unsigned long)))
  303.              | DISPATCHED_STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(StringPtr)))
  304.              | DISPATCHED_STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(short*)))
  305.              | DISPATCHED_STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(FCBRecPtr*))),
  306.     uppUTLocateNextFCBProcInfo = kD0DispatchedPascalStackBased
  307.              | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  308.              | DISPATCHED_STACK_ROUTINE_SELECTOR_SIZE(kFourByteCode)
  309.              | DISPATCHED_STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(VCBPtr)))
  310.              | DISPATCHED_STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(unsigned long)))
  311.              | DISPATCHED_STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(StringPtr)))
  312.              | DISPATCHED_STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(short*)))
  313.              | DISPATCHED_STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(FCBRecPtr*))),
  314.     uppUTIndexFCBProcInfo = kD0DispatchedPascalStackBased
  315.              | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  316.              | DISPATCHED_STACK_ROUTINE_SELECTOR_SIZE(kFourByteCode)
  317.              | DISPATCHED_STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(VCBPtr)))
  318.              | DISPATCHED_STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short*)))
  319.              | DISPATCHED_STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(FCBRecPtr*))),
  320.     uppUTResolveFCBProcInfo = kD0DispatchedPascalStackBased
  321.              | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  322.              | DISPATCHED_STACK_ROUTINE_SELECTOR_SIZE(kFourByteCode)
  323.              | DISPATCHED_STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short)))
  324.              | DISPATCHED_STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(FCBRecPtr*)))
  325. };
  326.  
  327. extern pascal OSErr MoreUTFindDrive(SInt16 driveNum, DrvQElPtr *driveQElementPtr)
  328. {
  329.     #if !TARGET_CPU_68K
  330.         if (MORE_MAC_OS_8_5_OR_LATER || (UTFindDrive != (void *) kUnresolvedCFragSymbolAddress)) {
  331.             return UTFindDrive(driveNum, driveQElementPtr);
  332.         } else
  333.     #endif
  334.         {
  335.             UniversalProcPtr trapAddress;
  336.             
  337.             // Check that I've got the ProcInfo correct.  This magic value
  338.             // was extracted from InterfaceLib on Mac OS 8.5.
  339.  
  340.             MoreAssertQ(uppUTFindDriveProcInfo == 0x0EE8);
  341.             
  342.             trapAddress = GetToolTrapAddress(_HFSUtilDispatch);
  343.             return CallUniversalProc(trapAddress, uppUTFindDriveProcInfo, 15, driveNum, driveQElementPtr);
  344.         }
  345. }
  346.  
  347. extern pascal OSErr MoreUTLocateFCB(VCBPtr                 volCtrlBlockPtr,
  348.                                  unsigned long             fileNum,
  349.                                  StringPtr                 namePtr,
  350.                                  short *                fileRefNum,
  351.                                  FCBRecPtr *            fileCtrlBlockPtr)
  352. {
  353.     #if !TARGET_CPU_68K
  354.         if (MORE_MAC_OS_8_5_OR_LATER || (UTLocateFCB != (void *) kUnresolvedCFragSymbolAddress)) {
  355.             return UTLocateFCB(volCtrlBlockPtr, fileNum, namePtr, fileRefNum, fileCtrlBlockPtr);
  356.         } else
  357.     #endif
  358.         {
  359.             UniversalProcPtr trapAddress;
  360.             
  361.             // Check that I've got the ProcInfo correct.  This magic value
  362.             // was extracted from InterfaceLib on Mac OS 8.5.
  363.  
  364.             MoreAssertQ(uppUTLocateFCBProcInfo == 0x03FFE8);
  365.             
  366.             trapAddress = GetToolTrapAddress(_HFSUtilDispatch);
  367.             return CallUniversalProc(trapAddress, uppUTLocateFCBProcInfo, 2, volCtrlBlockPtr, fileNum, namePtr, fileRefNum, fileCtrlBlockPtr);
  368.         }
  369. }
  370.  
  371. extern pascal OSErr MoreUTLocateNextFCB(VCBPtr             volCtrlBlockPtr,
  372.                                  unsigned long             fileNum,
  373.                                  StringPtr                 namePtr,
  374.                                  short *                fileRefNum,
  375.                                  FCBRecPtr *            fileCtrlBlockPtr)
  376. {
  377.     #if !TARGET_CPU_68K
  378.         if (MORE_MAC_OS_8_5_OR_LATER || (UTLocateNextFCB != (void *) kUnresolvedCFragSymbolAddress)) {
  379.             return UTLocateNextFCB(volCtrlBlockPtr, fileNum, namePtr, fileRefNum, fileCtrlBlockPtr);
  380.         } else
  381.     #endif
  382.         {
  383.             UniversalProcPtr trapAddress;
  384.             
  385.             // Check that I've got the ProcInfo correct.  This magic value
  386.             // was extracted from InterfaceLib on Mac OS 8.5.
  387.  
  388.             MoreAssertQ(uppUTLocateNextFCBProcInfo == 0x03FFE8);
  389.             
  390.             trapAddress = GetToolTrapAddress(_HFSUtilDispatch);
  391.             return CallUniversalProc(trapAddress, uppUTLocateNextFCBProcInfo, 3, volCtrlBlockPtr, fileNum, namePtr, fileRefNum, fileCtrlBlockPtr);
  392.         }
  393. }
  394.  
  395. extern pascal OSErr MoreUTIndexFCB(VCBPtr                 volCtrlBlockPtr,
  396.                                  short *                fileRefNum,
  397.                                  FCBRecPtr *            fileCtrlBlockPtr)
  398. {
  399.     #if !TARGET_CPU_68K
  400.         if (MORE_MAC_OS_8_5_OR_LATER || (UTIndexFCB != (void *) kUnresolvedCFragSymbolAddress)) {
  401.             return UTIndexFCB(volCtrlBlockPtr, fileRefNum, fileCtrlBlockPtr);
  402.         } else
  403.     #endif
  404.         {
  405.             UniversalProcPtr trapAddress;
  406.             
  407.             // Check that I've got the ProcInfo correct.  This magic value
  408.             // was extracted from InterfaceLib on Mac OS 8.5.
  409.  
  410.             MoreAssertQ(uppUTIndexFCBProcInfo == 0x03FE8);
  411.             
  412.             trapAddress = GetToolTrapAddress(_HFSUtilDispatch);
  413.             return CallUniversalProc(trapAddress, uppUTIndexFCBProcInfo, 4, volCtrlBlockPtr, fileRefNum, fileCtrlBlockPtr);
  414.         }
  415. }
  416.  
  417. extern pascal OSErr MoreUTResolveFCB(short                 fileRefNum,
  418.                                  FCBRecPtr *            fileCtrlBlockPtr)
  419. {
  420.     #if !TARGET_CPU_68K
  421.         if (MORE_MAC_OS_8_5_OR_LATER || (UTResolveFCB != (void *) kUnresolvedCFragSymbolAddress)) {
  422.             return UTResolveFCB(fileRefNum, fileCtrlBlockPtr);
  423.         } else
  424.     #endif
  425.         {
  426.             UniversalProcPtr trapAddress;
  427.             
  428.             // Check that I've got the ProcInfo correct.  This magic value
  429.             // was extracted from InterfaceLib on Mac OS 8.5.
  430.  
  431.             MoreAssertQ(uppUTResolveFCBProcInfo == 0x0EE8);
  432.             
  433.             trapAddress = GetToolTrapAddress(_HFSUtilDispatch);
  434.             return CallUniversalProc(trapAddress, uppUTResolveFCBProcInfo, 5, fileRefNum, fileCtrlBlockPtr);
  435.         }
  436. }
  437.  
  438. #endif
  439.  
  440. /////////////////////////////////////////////////////////////////
  441.  
  442. #if TARGET_RT_MAC_CFM
  443.  
  444. enum {
  445.     uppAddDriveProcInfo = kRegisterBased |
  446.             RESULT_SIZE(SIZE_CODE(sizeof(OSErr))) |
  447.             REGISTER_RESULT_LOCATION(kRegisterD0) |
  448.             REGISTER_ROUTINE_PARAMETER(1, kRegisterD1, SIZE_CODE(sizeof(short))) |
  449.             REGISTER_ROUTINE_PARAMETER(2, kRegisterA0, SIZE_CODE(sizeof(DrvQElPtr))) |
  450.             REGISTER_ROUTINE_PARAMETER(3, kRegisterD0, SIZE_CODE(sizeof(long)))
  451. };
  452.  
  453. // Some comments about the ProcInfo value:
  454. //
  455. // o It's set to return a result even though the high-level glue doesn't.
  456. //   This is because the trap returns a result in D0.  We can safely ignored
  457. //   it from the C code.
  458. //
  459. // o The D1 parameter is listed as sizeof(short), not sizeof(long) which is
  460. //   the size used by most other OS traps.  The reason: I'm not sure.
  461. //   Come to think of it, sizeof(short) makes more sense to me because
  462. //   that's what trap words are.  Anyway, I'm just parroting what
  463. //   InterfaceLib 8.5 does; my specific goal is to make CFM patches to
  464. //   AddDrive work properly, which requires that we all use identical
  465. //   ProcInfo's.
  466. //
  467. // o Register D0 contains the drvrRefNum and drvNum parameters combined,
  468. //   with drvNum in the high word and drvrRefNum in the low word.
  469. //   Oh, those wacky 68K calling conventions (-:
  470.  
  471. extern pascal void MoreAddDrive(DriverRefNum drvrRefNum, SInt16 drvNum, DrvQElPtr qEl)
  472. {
  473.     UInt32 response;
  474.     
  475.     if ( MORE_MAC_OS_8_5_OR_LATER || ((Gestalt(gestaltSystemVersion, (SInt32 *) &response) == noErr) && (response >= 0x0850))) {
  476.         AddDrive(drvrRefNum, drvNum, qEl);
  477.     } else {
  478.         UniversalProcPtr trapAddress;
  479.  
  480.         // Prior to Mac OS 8.5, the InterfaceLib glue for AddDrive was
  481.         // messed up, so we have to roll our own.
  482.         
  483.         // Check that I've got the ProcInfo correct.  This magic value
  484.         // was extracted from InterfaceLib on Mac OS 8.5.
  485.  
  486.         MoreAssertQ(uppAddDriveProcInfo == 0x0733022);
  487.         
  488.         trapAddress = GetOSTrapAddress(_AddDrive);
  489.         (void) CallOSTrapUniversalProc(trapAddress, uppAddDriveProcInfo, _AddDrive, qEl, ( ((UInt32) drvNum) << 16) | (UInt16) drvrRefNum);
  490.     }
  491. }
  492.  
  493. #else
  494.  
  495. // Unlike most of these glue routines, the 68K version of AddDrive 
  496. // is implemented as link-in glue.  Thus there are no inlines in the
  497. // interface file.  We therefore have to implement this routine for
  498. // classic 68K, as a simple call through to the real routine.
  499.  
  500. extern pascal void MoreAddDrive(DriverRefNum drvrRefNum, SInt16 drvNum, DrvQElPtr qEl)
  501. {
  502.     AddDrive(drvrRefNum, drvNum, qEl);
  503. }
  504.  
  505. #endif
  506.  
  507. /////////////////////////////////////////////////////////////////
  508.  
  509. #if TARGET_RT_MAC_CFM
  510.  
  511. enum {
  512.     _GestaltValue = 0xABF1
  513. };
  514.  
  515. enum {
  516.     uppNewGestaltValueProcInfo = kD0DispatchedPascalStackBased |
  517.             RESULT_SIZE(SIZE_CODE(sizeof(OSErr))) |
  518.             DISPATCHED_STACK_ROUTINE_SELECTOR_SIZE(SIZE_CODE(sizeof(short))) |
  519.             DISPATCHED_STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(OSType))) |
  520.             DISPATCHED_STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long))),
  521.     uppReplaceGestaltValueProcInfo = kD0DispatchedPascalStackBased |
  522.             RESULT_SIZE(SIZE_CODE(sizeof(OSErr))) |
  523.             DISPATCHED_STACK_ROUTINE_SELECTOR_SIZE(SIZE_CODE(sizeof(short))) |
  524.             DISPATCHED_STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(OSType))) |
  525.             DISPATCHED_STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long))),
  526.     uppSetGestaltValueProcInfo = kD0DispatchedPascalStackBased |
  527.             RESULT_SIZE(SIZE_CODE(sizeof(OSErr))) |
  528.             DISPATCHED_STACK_ROUTINE_SELECTOR_SIZE(SIZE_CODE(sizeof(short))) |
  529.             DISPATCHED_STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(OSType))) |
  530.             DISPATCHED_STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long))),
  531.     uppDeleteGestaltValueProcInfo = kD0DispatchedPascalStackBased |
  532.             RESULT_SIZE(SIZE_CODE(sizeof(OSErr))) |
  533.             DISPATCHED_STACK_ROUTINE_SELECTOR_SIZE(SIZE_CODE(sizeof(short))) |
  534.             DISPATCHED_STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(OSType)))
  535. };
  536.  
  537. // The glue I use here is especially cheesy.  In general, I try
  538. // to avoid using the pre-processor for generating bogus C syntax,
  539. // ie I only use #if where I could syntactically use if().  However,
  540. // in this case I've been forced to break my own rules.  The problem
  541. // is that NewGestaltValue etc are not present in Universal Interface's
  542. // 3.2 InterfaceLib for CFM-68K.  Why?  I don't know for sure, but it
  543. // could be because they are only available in the real InterfaceLib for
  544. // Mac OS 8.5 and higher, and that can't be run on 68K machines.  Anyway,
  545. // given that they're not available in InterfaceLib, you can't reference
  546. // the symbol in the CFM-68K build, which requires ugly preprocessor
  547. // stuff.  There may be a better way of doing this, but I'm pushed for
  548. // time right now.  I hope to revisit it eventually.
  549. // -- Quinn, 20 Apr 1999
  550.  
  551. extern pascal OSErr MoreNewGestaltValue(OSType selector, long newValue)
  552. {
  553.     #if !TARGET_CPU_68K
  554.         if (MORE_MAC_OS_8_5_OR_LATER || (NewGestaltValue != (void *) kUnresolvedCFragSymbolAddress)) {
  555.             return NewGestaltValue(selector, newValue);
  556.         } else
  557.     #endif
  558.         {
  559.             UniversalProcPtr trapAddress;
  560.             
  561.             // Check that I've got the ProcInfo correct.  This magic value
  562.             // was extracted from InterfaceLib on Mac OS 8.5.
  563.  
  564.             MoreAssertQ(uppNewGestaltValueProcInfo == 0x00000FA8);
  565.             
  566.             trapAddress = GetToolboxTrapAddress(_GestaltValue);
  567.             return CallUniversalProc(trapAddress, uppNewGestaltValueProcInfo, 0x0401, selector, newValue);
  568.         }
  569. }
  570.  
  571. extern pascal OSErr MoreReplaceGestaltValue(OSType selector, long replacementValue)
  572. {
  573.     #if !TARGET_CPU_68K
  574.         if (MORE_MAC_OS_8_5_OR_LATER || (ReplaceGestaltValue != (void *) kUnresolvedCFragSymbolAddress)) {
  575.             return ReplaceGestaltValue(selector, replacementValue);
  576.         } else
  577.     #endif
  578.         {
  579.             UniversalProcPtr trapAddress;
  580.             
  581.             // Check that I've got the ProcInfo correct.  This magic value
  582.             // was extracted from InterfaceLib on Mac OS 8.5.
  583.  
  584.             MoreAssertQ(uppReplaceGestaltValueProcInfo == 0x00000FA8);
  585.             
  586.             trapAddress = GetToolboxTrapAddress(_GestaltValue);
  587.             return CallUniversalProc(trapAddress, uppReplaceGestaltValueProcInfo, 0x0402, selector, replacementValue);
  588.         }
  589. }
  590.  
  591. extern pascal OSErr MoreSetGestaltValue(OSType selector, long newValue)        
  592. {
  593.     #if !TARGET_CPU_68K
  594.         if (MORE_MAC_OS_8_5_OR_LATER || (SetGestaltValue != (void *) kUnresolvedCFragSymbolAddress)) {
  595.             return SetGestaltValue(selector, newValue);
  596.         } else
  597.     #endif
  598.         {
  599.             UniversalProcPtr trapAddress;
  600.             
  601.             // Check that I've got the ProcInfo correct.  This magic value
  602.             // was extracted from InterfaceLib on Mac OS 8.5.
  603.  
  604.             MoreAssertQ(uppSetGestaltValueProcInfo == 0x00000FA8);
  605.             
  606.             trapAddress = GetToolboxTrapAddress(_GestaltValue);
  607.             return CallUniversalProc(trapAddress, uppSetGestaltValueProcInfo, 0x0404, selector, newValue);
  608.         }
  609. }
  610.  
  611. extern pascal OSErr MoreDeleteGestaltValue(OSType selector)
  612. {
  613.     #if !TARGET_CPU_68K
  614.         if (MORE_MAC_OS_8_5_OR_LATER || (DeleteGestaltValue != (void *) kUnresolvedCFragSymbolAddress)) {
  615.             return DeleteGestaltValue(selector);
  616.         } else
  617.     #endif
  618.         {
  619.             UniversalProcPtr trapAddress;
  620.             
  621.             // Check that I've got the ProcInfo correct.  This magic value
  622.             // was extracted from InterfaceLib on Mac OS 8.5.
  623.  
  624.             MoreAssertQ(uppDeleteGestaltValueProcInfo == 0x000003A8);
  625.             
  626.             trapAddress = GetToolboxTrapAddress(_GestaltValue);
  627.             return CallUniversalProc(trapAddress, uppDeleteGestaltValueProcInfo, 0x0203, selector);
  628.         }
  629. }
  630.  
  631. #endif
  632.  
  633. /////////////////////////////////////////////////////////////////
  634.  
  635. #if TARGET_RT_MAC_CFM
  636.  
  637. // Golly, this one is ugly.  In prior to ARA 3.0, this trap was
  638. // implemented by 68K code that used D0 as a selector.  But
  639. // with ARA 3.0, this trap is implemented by PowerPC code whose
  640. // ProcInfo doesn't include the D0 selector.  So, you can either
  641. // declare the ProcInfo to include the selector, and then you won't
  642. // work with ARA 3.0 and higher, or you can declare it without
  643. // the selector, in which case register D0 won't be set up
  644. // and you won't work with ARA < 3.0.  Nasty.
  645. //
  646. // The long term solution is to check the version number of ARA
  647. // and do the right thing for each version.  Alas, I don't have
  648. // time to code and test that solution.  So I'm sticking with
  649. // the ARA 3.x solution for the moment.
  650. //
  651. // Bletch!
  652. //
  653. // Quinn, 16 Aug 1999
  654.  
  655. enum {
  656.     _RemoteAccess = 0xAA5B
  657. };
  658.  
  659. enum {
  660.     uppPBRemoteAccessProcInfo = kPascalStackBased
  661.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  662.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(TPRemoteAccessParamBlock)))
  663.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Boolean)))
  664. };
  665.  
  666. extern pascal OSErr MorePBRemoteAccess(TPRemoteAccessParamBlock paramBlock, Boolean async)
  667.     // There is still no InterfaceLib entry for PBRemoteAccess, so
  668.     // we always do the CallUniversalProc thing.
  669. {
  670.     UniversalProcPtr trapAddress;
  671.     
  672.     trapAddress = GetToolboxTrapAddress(_RemoteAccess);
  673.     return CallUniversalProc(trapAddress, uppPBRemoteAccessProcInfo, paramBlock, async);
  674. }
  675.  
  676. #endif
  677.  
  678. /////////////////////////////////////////////////////////////////
  679.  
  680. #if TARGET_RT_MAC_CFM
  681.  
  682. enum {
  683.     uppDIXFormatProcInfo = kStackDispatchedPascalStackBased |
  684.             RESULT_SIZE(SIZE_CODE(sizeof(OSErr))) |
  685.             DISPATCHED_STACK_ROUTINE_SELECTOR_SIZE(SIZE_CODE(sizeof(short))) |
  686.             DISPATCHED_STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short))) |
  687.             DISPATCHED_STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Boolean))) |
  688.             DISPATCHED_STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(unsigned long))) |
  689.             DISPATCHED_STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(unsigned long *))),
  690.     uppDIXZeroProcInfo = kStackDispatchedPascalStackBased |
  691.             RESULT_SIZE(SIZE_CODE(sizeof(OSErr))) |
  692.             DISPATCHED_STACK_ROUTINE_SELECTOR_SIZE(SIZE_CODE(sizeof(short))) |
  693.             DISPATCHED_STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short))) |
  694.             DISPATCHED_STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(ConstStr255Param))) |
  695.             DISPATCHED_STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short))) |
  696.             DISPATCHED_STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(short))) |
  697.             DISPATCHED_STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(short))) |
  698.             DISPATCHED_STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(unsigned long))) |
  699.             DISPATCHED_STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(void *))),
  700.     uppDIReformatProcInfo = kStackDispatchedPascalStackBased |
  701.             RESULT_SIZE(SIZE_CODE(sizeof(OSErr))) |
  702.             DISPATCHED_STACK_ROUTINE_SELECTOR_SIZE(SIZE_CODE(sizeof(short))) |
  703.             DISPATCHED_STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short))) |
  704.             DISPATCHED_STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short))) |
  705.             DISPATCHED_STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(ConstStr255Param))) |
  706.             DISPATCHED_STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(ConstStr255Param)))
  707. };
  708.  
  709. // These routines use the same cheesy glue structure as the Gestalt Value
  710. // routines, for much the same reasons.  See the comment above MoreNewGestaltValue
  711. // for more details.
  712.  
  713. extern pascal OSErr MoreDIXFormat(     short                     drvNum,
  714.                                      Boolean                 fmtFlag,
  715.                                      unsigned long             fmtArg,
  716.                                      unsigned long *        actSize)
  717. {
  718.     #if !TARGET_CPU_68K
  719.         if (MORE_MAC_OS_8_5_OR_LATER || (DIXFormat != (void *) kUnresolvedCFragSymbolAddress)) {
  720.             return DIXFormat(drvNum, fmtFlag, fmtArg, actSize);
  721.         } else
  722.     #endif
  723.         {
  724.             UniversalProcPtr trapAddress;
  725.             
  726.             // Check that I've got the ProcInfo correct.  This magic value
  727.             // was extracted from InterfaceLib on Mac OS 8.5.
  728.  
  729.             MoreAssertQ(uppDIXFormatProcInfo == 0x0000F6AE);
  730.             
  731.             trapAddress = GetToolboxTrapAddress(_Pack2);
  732.             return CallUniversalProc(trapAddress, uppDIXFormatProcInfo, 0x000C, drvNum, fmtFlag, fmtArg, actSize);
  733.         }
  734. }
  735.  
  736. extern pascal OSErr MoreDIXZero(     short                     drvNum,
  737.                                      ConstStr255Param         volName,
  738.                                      short                     fsid,
  739.                                      short                     mediaStatus,
  740.                                      short                     volTypeSelector,
  741.                                      unsigned long             volSize,
  742.                                      void *                    extendedInfoPtr)
  743. {
  744.     #if !TARGET_CPU_68K
  745.         if (MORE_MAC_OS_8_5_OR_LATER || (DIXZero != (void *) kUnresolvedCFragSymbolAddress)) {
  746.             return DIXZero(drvNum, volName, fsid, mediaStatus, volTypeSelector, volSize, extendedInfoPtr);
  747.         } else
  748.     #endif
  749.         {
  750.             UniversalProcPtr trapAddress;
  751.             
  752.             // Check that I've got the ProcInfo correct.  This magic value
  753.             // was extracted from InterfaceLib on Mac OS 8.5.
  754.  
  755.             MoreAssertQ(uppDIXZeroProcInfo == 0x003EAEAE);
  756.             
  757.             trapAddress = GetToolboxTrapAddress(_Pack2);
  758.             return CallUniversalProc(trapAddress, uppDIXZeroProcInfo, 0x000E, drvNum, volName, fsid, mediaStatus, volTypeSelector, volSize, extendedInfoPtr);
  759.         }
  760. }
  761.  
  762.  
  763. extern pascal OSErr MoreDIReformat(     short                     drvNum,
  764.                                      short                     fsid,
  765.                                      ConstStr255Param         volName,
  766.                                      ConstStr255Param         msgText)
  767. {
  768.     #if !TARGET_CPU_68K
  769.         if (MORE_MAC_OS_8_5_OR_LATER || (DIReformat != (void *) kUnresolvedCFragSymbolAddress)) {
  770.             return DIReformat(drvNum, fsid, volName, msgText);
  771.         } else
  772.     #endif
  773.         {
  774.             UniversalProcPtr trapAddress;
  775.             
  776.             // Check that I've got the ProcInfo correct.  This magic value
  777.             // was extracted from InterfaceLib on Mac OS 8.5.
  778.  
  779.             MoreAssertQ(uppDIReformatProcInfo == 0x0000FAAE);
  780.             
  781.             trapAddress = GetToolboxTrapAddress(_Pack2);
  782.             return CallUniversalProc(trapAddress, uppDIReformatProcInfo, 0x0010, drvNum, fsid, volName, msgText);
  783.         }
  784. }
  785.  
  786. #endif
  787.  
  788. /////////////////////////////////////////////////////////////////
  789.  
  790. // the routine uses the same cheesy glue structure as the Gestalt Value
  791. // routines, for much the same reasons.  See the comment above MoreNewGestaltValue
  792. // for more details.
  793.  
  794. extern pascal void MoreBlockZero(void * destPtr, Size byteCount)
  795. {
  796.     #if TARGET_RT_MAC_CFM && !TARGET_CPU_68K
  797.         if (MORE_MAC_OS_8_5_OR_LATER || (BlockZero != (void *) kUnresolvedCFragSymbolAddress)) {
  798.             BlockZero(destPtr, byteCount);
  799.         } else 
  800.     #endif
  801.         {
  802.             UInt8 *cursor;
  803.             
  804.             cursor = (UInt8 *) destPtr;
  805.             while (byteCount != 0) {
  806.                 *cursor = 0;
  807.                 cursor += 1;
  808.                 byteCount -= 1;
  809.             }
  810.         }
  811. }
  812.  
  813. /////////////////////////////////////////////////////////////////
  814.  
  815. #if TARGET_RT_MAC_CFM
  816.  
  817. // These routines were added into InterfaceLib in Mac OS 9.0.2.
  818. // Unfortunately, they’re still not in the InterfaceLib stub
  819. // library (UI 3.3.1b4).  So I don’t use the "try InterfaceLib
  820. // then revert to glue" approach I use for many other routines.
  821. // Instead, I always use the glue.  I need to fix this when
  822. // InterfaceLib gets update.
  823. //
  824. // Also, I don’t have hard values for the ProcInfos because
  825. // I haven’t had the opportunity to extract them from a Mac OS
  826. // 9.0.2 (or above) system.  I need to fix that ASAP.
  827.  
  828. enum {
  829.     uppInstallTimeTaskProcInfo = kRegisterBased
  830.         | REGISTER_RESULT_LOCATION(kRegisterD0)
  831.         | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  832.         | REGISTER_ROUTINE_PARAMETER(1, kRegisterD1, SIZE_CODE(sizeof(long)))
  833.         | REGISTER_ROUTINE_PARAMETER(2, kRegisterA0, SIZE_CODE(sizeof(QElemPtr))),
  834.     uppInstallXTimeTaskProcInfo = kRegisterBased
  835.         | REGISTER_RESULT_LOCATION(kRegisterD0)
  836.         | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  837.         | REGISTER_ROUTINE_PARAMETER(1, kRegisterD1, SIZE_CODE(sizeof(long)))
  838.         | REGISTER_ROUTINE_PARAMETER(2, kRegisterA0, SIZE_CODE(sizeof(QElemPtr))),
  839.     uppPrimeTimeTaskProcInfo = kRegisterBased
  840.         | REGISTER_RESULT_LOCATION(kRegisterD0)
  841.         | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  842.         | REGISTER_ROUTINE_PARAMETER(1, kRegisterD1, SIZE_CODE(sizeof(long)))
  843.         | REGISTER_ROUTINE_PARAMETER(2, kRegisterA0, SIZE_CODE(sizeof(QElemPtr)))
  844.         | REGISTER_ROUTINE_PARAMETER(3, kRegisterD0, SIZE_CODE(sizeof(long))),
  845.     uppRemoveTimeTaskProcInfo = kRegisterBased
  846.         | REGISTER_RESULT_LOCATION(kRegisterD0)
  847.         | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  848.         | REGISTER_ROUTINE_PARAMETER(1, kRegisterD1, SIZE_CODE(sizeof(long)))
  849.         | REGISTER_ROUTINE_PARAMETER(2, kRegisterA0, SIZE_CODE(sizeof(QElemPtr)))
  850. };
  851.  
  852. extern pascal OSErr MoreInstallTimeTask(QElemPtr tmTaskPtr)
  853. {
  854.     UniversalProcPtr trapAddress;
  855.     
  856.     // MoreAssertQ(uppInsTimeTaskProcInfo == 0x????????);
  857.     
  858.     trapAddress = GetOSTrapAddress(_InsTime);
  859.     return CallOSTrapUniversalProc(trapAddress, uppInstallTimeTaskProcInfo, _InsTime, tmTaskPtr);
  860. }
  861.  
  862. extern pascal OSErr MoreInstallXTimeTask(QElemPtr tmTaskPtr)
  863. {
  864.     UniversalProcPtr trapAddress;
  865.     
  866.     // MoreAssertQ(uppInsTimeTaskProcInfo == 0x????????);
  867.     
  868.     trapAddress = GetOSTrapAddress(_InsTime);
  869.     return CallOSTrapUniversalProc(trapAddress, uppInstallTimeTaskProcInfo, _InsXTime, tmTaskPtr);
  870. }
  871.  
  872. extern pascal OSErr MorePrimeTimeTask(QElemPtr tmTaskPtr, long count)
  873. {
  874.     UniversalProcPtr trapAddress;
  875.     
  876.     // MoreAssertQ(uppPrimeTimeTaskProcInfo == 0x????????);
  877.     
  878.     trapAddress = GetOSTrapAddress(_PrimeTime);
  879.     return CallOSTrapUniversalProc(trapAddress, uppPrimeTimeTaskProcInfo, _PrimeTime, tmTaskPtr, count);
  880. }
  881.  
  882. extern pascal OSErr MoreRemoveTimeTask(QElemPtr tmTaskPtr)
  883. {
  884.     UniversalProcPtr trapAddress;
  885.     
  886.     // MoreAssertQ(uppRemoveTimeTaskProcInfo == 0x????????);
  887.     
  888.     trapAddress = GetOSTrapAddress(_RmvTime);
  889.     return CallOSTrapUniversalProc(trapAddress, uppRemoveTimeTaskProcInfo, _RmvTime, tmTaskPtr);
  890. }
  891.  
  892. #endif
  893.  
  894. /////////////////////////////////////////////////////////////////
  895.